package com.grade.system.mapper;

import com.grade.system.entity.Student;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface StudentMapper {

    @Select("select * from student")
    List<Student> selStudentByAll();

    @Select("select * from student where id = #{id}")
    Student selStudentById(int id);

    @Insert("insert student(name,sex,age,phone,native_place) values(#{name},#{sex},#{age},#{phone},#{native_place})")
    boolean insStudent(Student student);

    @Update("update student set name = #{name},sex=#{sex},age=#{age},phone=#{phone},native_place=#{native_place} where id = #{id} ")
    boolean updStudentById(Student student);

    @Delete("delete from student where id = #{id}")
    boolean delStudentById(int id);
}
